package com.ruoyi.fetv.service.impl;

import java.util.List;

import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.fetv.mapper.FetvSchoolMapper;
import com.ruoyi.fetv.service.IFetvSchoolService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.fetv.domain.FetvSchool;

/**
 * 学校Service业务层处理
 * 
 * @author éé­æ°
 * @date 2023-02-24
 */
@Service
public class FetvSchoolServiceImpl implements IFetvSchoolService
{
    @Autowired
    private FetvSchoolMapper fetvSchoolMapper;

    /**
     * 查询学校
     * 
     * @param schoolId 学校主键
     * @return 学校
     */
    @Override
    public FetvSchool selectFetvSchoolBySchoolId(Integer schoolId)
    {
        return fetvSchoolMapper.selectFetvSchoolBySchoolId(schoolId);
    }

    /**
     * 查询学校列表
     * 
     * @param fetvSchool 学校
     * @return 学校
     */
    @Override
    public List<FetvSchool> selectFetvSchoolList(FetvSchool fetvSchool)
    {
        return fetvSchoolMapper.selectFetvSchoolList(fetvSchool);
    }

    /**
     * 新增学校
     *
     * @param fetvSchool 学校
     * @return 结果
     */
    @Override
    public int insertFetvSchool(FetvSchool fetvSchool)
    {
        fetvSchool.setCreateTime(DateUtils.getNowDate());
        return fetvSchoolMapper.insertFetvSchool(fetvSchool);
    }

    /**
     * 修改学校
     *
     * @param fetvSchool 学校
     * @return 结果
     */
    @Override
    public int updateFetvSchool(FetvSchool fetvSchool)
    {
        fetvSchool.setUpdateTime(DateUtils.getNowDate());
        return fetvSchoolMapper.updateFetvSchool(fetvSchool);
    }

    /**
     * 批量删除学校
     * 
     * @param schoolIds 需要删除的学校主键
     * @return 结果
     */
    @Override
    public int deleteFetvSchoolBySchoolIds(Integer[] schoolIds)
    {
        return fetvSchoolMapper.deleteFetvSchoolBySchoolIds(schoolIds);
    }

    /**
     * 删除学校信息
     * 
     * @param schoolId 学校主键
     * @return 结果
     */
    @Override
    public int deleteFetvSchoolBySchoolId(Integer schoolId)
    {
        return fetvSchoolMapper.deleteFetvSchoolBySchoolId(schoolId);
    }
}
